<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="../lib/angularjs.js"></script>
</head>

<body ng-app="myApp" ng-controller="myCtrl">
    <!-- 单独使用updateOn -->
    <input type="text" ng-model="content" ng-model-options="{ updateOn: 'blur' }">
    <div>{{content}}</div>
    <!-- 将updateOn和debounce结合使用，也就是在输入的时候使用debounce延迟触发，blur之后马上触发 -->
    <input type="text" ng-model="text"
        ng-model-options="{ updateOn: 'default blur', debounce: { default: 2000, blur: 0 } }">
    <div>{{text}}</div>
</body>

<script>
    const myApp = angular.module("myApp", [])
    myApp.controller("myCtrl", ["$scope", function ($scope) {
        $scope.content = "修改内容";
        $scope.text = "update content"
    }])
</script>

</html>